home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / kaffe-0.2 / include / native.h < prev    next >
C/C++ Source or Header  |  1996-02-12  |  2KB  |  72 lines

  1. /*
  2.  * native.h
  3.  * Native method support.
  4.  *
  5.  * Copyright (c) 1996 Systems Architecture Research Centre,
  6.  *           City University, London, UK.
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
  12.  */
  13.  
  14. #ifndef __native_h
  15. #define __native_h
  16.  
  17. struct _methods;
  18. struct _classes;
  19. struct _thread;
  20.  
  21. /* From object.h */
  22. #define    __object_h
  23. typedef struct _object {
  24.     struct _methodTable*    mtable;
  25.     unsigned int        idx;
  26.     unsigned int        size;
  27.     struct _classes*     type;
  28.     int            final;
  29.     struct _thread*        holder;
  30.     int            count;
  31.     struct _thread*        muxWaiters;
  32.     struct _thread*        cvWaiters;
  33.     char            data[0];
  34. } object;
  35.  
  36. /* From baseClasses.h */
  37. typedef struct _stringClass {
  38.     object        head;
  39.     object*        value;
  40.     int        offset;
  41.     int        count;
  42. } stringClass;
  43.  
  44. /* Build an object handle */
  45. #define    HandleTo(class)                    \
  46.     struct H##class {                \
  47.         object obj;                \
  48.         struct Class##class data[0];        \
  49.     }
  50.  
  51. /* Turn a handle into the real thing */
  52. #define    unhand(o)    ((o)->data)
  53.  
  54. /* Some internal machine object conversions to "standard" types. */
  55. #define    Hjava_lang_Object    _object
  56. #define    Hjava_lang_String    _stringClass
  57. #define    Hjava_lang_Class    _classes
  58. #define    HArray            struct _object
  59.  
  60. extern char* javaString2CString(struct Hjava_lang_String*, char*, int);
  61. extern struct Hjava_lang_String* makeJavaString(char*, int);
  62.  
  63. long    do_execute_java_method(void*, object*, char*, char*, struct _methods*, int, ...);
  64. long    do_execute_java_class_method(char*, char*, char*, ...);
  65. object* execute_java_constructor(void*, char*, struct _classes*, char*, ...);
  66.  
  67. void    SignalError(void*, char*, char*);
  68.  
  69. void    classname2pathname(char*, char*);
  70.  
  71. #endif
  72.